The present invention relates to data processing by digital computer, and more particularly to document object model caching and validation.
Computers can communicate through the use of various Internet technologies. For example, a server computer can send “pages” to a client computer. In this specification, pages are also referred to as user interface (UI) pages. Such pages typically include instructions in a markup language (e.g., Hypertext Markup Language (HTML)), and/or in a script language (e.g., JavaScript). The client computer can use a Web browser to interpret the pages and thereby provide screen presentations to a user. The appearance of the screen presentations can change upon the occurrence of various events—e.g., when the user interacts with or navigates through various UI elements of a page, when the user enters data, or when the server computer updates a page.
Ensuring adequate performance of applications that require client-server communication can be challenging because of numerous limitations, including: limitations in communication speed and the bandwidth that is available, the time required for client-server roundtrips, and the time-consuming computations required to provide the screen presentations (rendering) at the client computer in cases where the client computer is responsible the rendering.
Various techniques can be used to alleviate the problems created by such limitations. For example, layout (e.g., arrangement of elements on screen), style (e.g., fonts, colors), and content (e.g., text messages or pictures) can be transmitted to a client separately. A browser can combine the appropriate layout, style, and content at the time of presentation. However, requests from the client to the server for presentation updates may still require client-server communication (in both directions, so-called roundtrips).
Applications that are built according to the model-view-controller (MVC) design methodology provide views that present an application model to a user. The user can interact with the views, causing a corresponding controller to manipulate the model. The model can then update its views as appropriate. A UI page of an application can include multiple views. The structure of a UI page can be described as a UI tree structure, where the root node of the tree represents the UI page, and child nodes represent UI elements included in the page. The UI elements can include one or more views and one or more controls through which a user interacts with, provides input to, and/or controls the application. Some examples of controls are text fields, radio buttons, tables, trays, and drop-down menus. Each node can have further child nodes (for example, to represent nested views).
An application running on a server computer can send a UI page with markup language portions that describe the UI elements of a UI page to a client computer with a browser. The client can parse the markup language portions of the UI page and build a document object model (DOM) of the UI page. The DOM (e.g., HTML DOM) can include nodes in a DOM hierarchy that represent the UI elements of the UI page in the browser. The browser presents a screen presentation of the UI page that corresponds to the DOM.
When a request is triggered (e.g., by a user interaction, or an interaction with another computer system) that results in a change to a UI element (e.g., a new data value or background color for the UI element), typically, the whole UI page is re-rendered. This can cause unpleasant effects for the user. For example, the user may have to wait for the entire DOM to be regenerated, and when the new DOM is finally presented, it can cause the browser screen to flicker.